"""
@author: tk
@file: Christmas gift.py
@time: 2022/11/4 20:57
"""
# 圣诞节到了,互送礼物,每个员工买一个礼物,员工系统随机抽,第被抽到的一个人把礼物送给第二个人,不能送给自己,最后要求人手一份礼物
# 1.定义好公司员工名单
# 2.循环系统随机抽取一个收取礼物的人
# 3.打印最后的送礼和收礼关系
import random

import random

people = ['史珍香', '杜子腾', '元子诞', '沙光光', '任扎', '董士掌']
a = ['史珍香', '杜子腾', '元子诞', '沙光光', '任扎', '董士掌']
take = []
c = []

def gif():
    for give in people:
        take = a[1:]
        a.append(a.pop(0))
        have = random.choice(take)

        i = 1
        while have in c:
            have = random.choice(take)
            i += 1
            if i == 100:
                return
        else:
            c.append(have)


gif()


print(len(c))
while len(c) == 5:
    people = ['史珍香', '杜子腾', '元子诞', '沙光光', '任扎', '董士掌']
    a = ['史珍香', '杜子腾', '元子诞', '沙光光', '任扎', '董士掌']
    take = []
    c = []
    gif()
else:
    print("送礼", people)
    print("收礼", c)

